<% layout("/common/layout.html",{"title":"工商资料打印"}){ %>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-5">
        <h2>工商申请列表</h2>
        <ol class="breadcrumb">
            <li><a href="${ctxPath}/admin/main">主页</a></li>
            <li><a href="../view/index">工商申请列表</a></li>
            <li class="active">资料打印</li>
        </ol>
    </div>
    <div class="col-sm-7">
        <div class="title-action">
            <div class="btn-group">
                <a class="btn btn-primary btn-outline" href="../view/index"><i class="fa fa-reply"> </i> 返回列表</a>
            </div>
            <div class="btn-group">
                <div class="btn btn-danger " href="/static/report/download/grbsctl6.exe">安装报表插件</div>
                <a class="btn btn-danger btn-outline" href="/static/report/download/grbsctl6.exe"><i class="fa fa-download"> </i> 节点1</a>
                <a class="btn btn-danger btn-outline" href="http://www.rubylong.cn/download/grbsctl6.exe" target="_blank"><i class="fa fa-download"> </i> 节点2</a>
            </div>
        </div>
    </div>
</div>


<div class="wrapper wrapper-content">
    <div class="tabs-container" id="tabs-container">
        <ul class="nav nav-tabs">
            <li class="active"><a data-toggle="tab" href="#apply" aria-expanded="true">公司登记(备案)申请书</a></li>
            <li class=""><a data-toggle="tab" href="#shareholder" aria-expanded="false">股东</a></li>
            <li class=""><a data-toggle="tab" href="#legal" aria-expanded="false">附表1</a></li>
            <li class=""><a data-toggle="tab" href="#supervisor" aria-expanded="false">附表2</a></li>
            <li class=""><a data-toggle="tab" href="#capital" aria-expanded="false">附表3</a></li>
            <li class=""><a data-toggle="tab" href="#financial" aria-expanded="false">附表4</a></li>
            <li class=""><a data-toggle="tab" href="#contact" aria-expanded="false">附表5</a></li>
            <li class=""><a data-toggle="tab" href="#operator" aria-expanded="false">附表6</a></li>
            <%if(isNotEmpty(shareholderList) && shareholderList.~size == 1){ %>
            <li class=""><a data-toggle="tab" href="#promise" aria-expanded="false">承诺书</a></li>
            <li class=""><a data-toggle="tab" href="#resolution" aria-expanded="false">股东决定</a></li>
            <li class=""><a data-toggle="tab" href="#rule" aria-expanded="false">公司章程</a></li>
            <li class=""><a data-toggle="tab" href="#abode" aria-expanded="false">住所申报承诺书</a></li>
            <% }else{ %>
            <li class=""><a data-toggle="tab" href="#abode" aria-expanded="false">住所申报承诺书</a></li>
            <li class=""><a data-toggle="tab" href="#resolutions" aria-expanded="false">股东会决议</a></li>
            <li class=""><a data-toggle="tab" href="#rules" aria-expanded="false">多人章程</a></li>
            <% }%>
        </ul>
        <div class="tab-content">
            <div id="apply" class="tab-pane active">
                <div class="panel-body">
                    <iframe style="border: 1px solid #ebebeb" class="mainiframe" src="/companyApply/report/apply/${company.id!}"  width="100%" height="700px" frameborder="0" scrolling="no"></iframe>
                </div>
            </div>

            <div id="shareholder" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>

            <div id="legal" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>

            <div id="supervisor" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>

            <div id="capital" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>

            <div id="financial" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>

            <div id="contact" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>

            <div id="operator" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>
            <div id="abode" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>
            <%if(isNotEmpty(shareholderList) && shareholderList.~size == 1){ %>
            <div id="promise" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>

            <div id="resolution" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>

            <div id="rule" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>
            <% }else{ %>
            <div id="resolutions" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>

            <div id="rules" class="tab-pane">
                <div class="panel-body">
                </div>
            </div>
            <% }%>

        </div>
    </div>
</div>

<% } %>
<script type="text/javascript">
    //页面JS调用
    require(['company/apply'], function (apply) {
        apply.print();

        $('#tabs-container > ul > li a').click(function (e) {
            $(this).tab('show');
            var iframeNode = $(this).attr("href");
            var action = iframeNode.substr(1,iframeNode.length);
            $(iframeNode).find(".panel-body").html("<iframe style=\"border: 1px solid #ebebeb\" class=\"mainiframe\" src=\"/companyApply/report/"+action+"/${company.id!}\"  width=\"100%\" height=\"700px\" frameborder=\"0\" scrolling=\"no\"></iframe>");
        })
    });
</script>
